<template>
	<view>
		<dev-navbar :title="title"></dev-navbar>
		<!-- 设备电量 -->

		<!-- 链接成功展示 -->
		<view class="" v-show="preTestSteps">
			<view class="equipment-power justify-content-l">
				<view class="align-items-l">
					<dev-svg-image mode="image" width="44" height="44"
						image-url="shoppingMall/C1E326377B184209BE4BC73A498C0A11.png">
					</dev-svg-image>
					<text class="characters">{{linkSucceeded?'已连接':'未连接'}}</text>

				</view>
				<!-- <view class="align-items-l">
					<dev-svg-image mode="image" width="24" height="40"
						image-url="shoppingMall/CED6A6120D594991A6E0CC5636CD0B87.png">
					</dev-svg-image>
					<text class="characters">15%</text>
				</view> -->
			</view>
			<!-- 测量提示 -->
			<view class="reminder">
				<dev-svg-image svgName="exclamationMark"></dev-svg-image>
				<text style="margin-left: 10rpx;">测量前请打开定位开关。</text>
			</view>

			<view class="measure-box">
				<view class="measurement-time">
					测量时间：{{measurementTime}}
				</view>

				<view class="data-below">
					<view class="value-box">
						<view class="">
							<view class="big-name">
								{{testData.highPre}}
							</view>
							<view class="small-name">
								收缩压mmHg
							</view>
						</view>
						<view class="">
							<view class="big-name" style="margin-left: -40rpx;margin-bottom: 40rpx;">
								/
							</view>
						</view>
						<view class="">
							<view class="big-name">
								{{testData.lowPre}}
							</view>
							<view class="small-name">
								舒张压mmHg
							</view>
						</view>
						<view class="">
							<view class="big-name">
								{{testData.heartRate}}
							</view>
							<view class="small-name">
								心率bpm
							</view>
						</view>
					</view>

					<view class="manual-input" @tap.stop="manualEntry()">
						<dev-svg-image svg-name="edit" modify-color="#FFFFFF"></dev-svg-image>
						<text style="margin-top: 10rpx;">手工录入</text>
					</view>
				</view>
			</view>

			<!-- 设备搜索 -->
			<view class="device-search">
				<view class="pointer-background" style="color: #85EABF;">
					{{resultText || ''}}
					<view class="pointer" v-if="pointerDisplay"
						:style="[{transform:'rotate(' + (testData.pressure*0.6) +'deg)'}]">
					</view>
				</view>
				<dev-button @tapDev="clickTheButton()" bgColor="linear-gradient(112deg, #52B29C 0%, #2EA7E0 100%)"
					width="402" height="90" top="40" radius="45" fontSize="34">{{btnText}}</dev-button>
			</view>

			<!-- 推荐商品 -->
			<view class="recommended-products">
				<navigator target="miniProgram" v-for="(item,index) in goodsList" :key="index" open-type="navigate"
					:app-id="shopAppId" :path="item.detailUrl" extra-data="" :version="version"
					hover-class="hoverbgfff">
					<view class="product-list">
						<dev-svg-image mode="image" :imageUrl="item.goodsImageUrl" radius="10" width="185" height="185">
						</dev-svg-image>
						<view class="detailed-information">
							<view class="product-description">
								{{item.title}}
							</view>
							<view class="">
								<text class="sale-price">¥{{item.salePrice}}</text>
								<text class="original-price">¥{{item.originalPrice}}</text>
							</view>
						</view>
					</view>
				</navigator>
			</view>

		</view>



		<view class="equipmentbg" v-show="!preTestSteps">
			<view class="step-description">
				<view class="bz-text">
					步骤1
				</view>
				<view class="small-text">
					请先确认设备处于工作状态，并打开手机蓝牙功能
				</view>
			</view>
			<dev-svg-image mode="image" imageUrl="shoppingMall/AFA34C3996234CFBA31EFEC286F7CFBD.png" width="750"
				height="420"></dev-svg-image>
			<view class="step-description">
				<view class="bz-text">
					步骤2
				</view>
				<view class="small-text">
					手机与设备连接成功后，请将臂带套在离手肘月2-3cm上端，身体保持放松，启动设备开始测量
				</view>
			</view>
			<dev-svg-image mode="image" imageUrl="shoppingMall/83CF9054A4D24957AF135B7E4D8212B7.png" width="750"
				height="420"></dev-svg-image>
			<view class="step-description">
				<view class="bz-text">
					步骤3
				</view>
				<view class="small-text">
					测量结束后请耐心等待测量结果
				</view>
			</view>
			<dev-iphone-bottom bgColor="none">
				<dev-button @tapDev="Search()" fontSize="32" width="650" height="90" radius="45" left="50" bottom="30"
					top="30">我已知悉</dev-button>
			</dev-iphone-bottom>

		</view>
		
		<u-modal z-index="10000" @confirm="startMeasurement" v-model="statusPopup" title="选择状态"
			:show-cancel-button="true" confirm-text="开始测量">
			<!-- 测量状态 -->
			<view class="measurement-status">
				<view class="every-button" v-for="(item,index) in statusList" :key="index">
					<dev-button @tapDev="selectionStatus(item,index)"
						:bgColor="item.selectFlag==1?'#2EA7E0':'#E2E1E2'" width="160">{{item.measureStatusName}}
					</dev-button>
				</view>
				<view style="width: 160rpx;"></view>
				<view style="width: 160rpx;"></view>
				<view style="width: 160rpx;"></view>
			</view>
		</u-modal>
	</view>
</template>

<script>
	import dayjs from '@/common/utils/day/day.js'

import uModal from "@/uview-ui/components/u-modal/u-modal.vue"
	export default {
		components: {
			uModal,
		},
		data() {
			return {
				measurementTime: '--', //测量时间
				goodsList: [], //商品集合
				title: '记录血压心率',
				preTestSteps: false, //是否阅读流程
				linkSucceeded: false, //是否链接成功
				btnText: '开始测量',
				measurementParameters: {}, //开始测量需要传递的参数
				name: '',
				connectedDeviceId: '',
				chooseType: 'Bioland-BPM', //血压计
				searching: false, //设备监听
				receiveText: '',
				serviceId: '',
				notifyCharacteristicsId: '',
				writeCharacteristicsId: '',
				connected: true,
				sevicePackets: '',
				testShow: false,
				testData: {
					pressure: 0,
					highPre: '--',
					lowPre: '--',
					heartRate: '--',
				},
				btndis: false,
				//判断是否主动断开
				activeClose: false,
				pakInfoList: [],
				scorollTop: 100,
				measuring: false, //是否在测量中


				clockInOrNot: false, //是否通过打卡进入

				dataTransferred: '', //传递过来的数据

				parseData: '', //解析后的数据
				statusList: [], //状态列表

				statusPopup: false, //状态弹框
				showAll: true,

				resultText: '', //测量结果

				pointerDisplay: true, //是否展示指针默认展示
                shopAppId: global.SHOP_APP_ID,
                version: global.IS_DEV?'trial':'release',

			};
		},
		onLoad(e) {
			if (e.data) {
				this.dataTransferred = e.data;
				this.parseData = JSON.parse(e.data);
				this.getListByGoodsIds(JSON.parse(e.data).goodsIds);
			}
			if (e.type == 1) {
				this.clockInOrNot = true
			} else {
				this.clockInOrNot = false
			}
			wx.setKeepScreenOn({
				keepScreenOn: true
			})
			console.log(this.parseData, '解析后的数据')
			this.getMeasurementStatus(); //获取测量状态
			// this.getResult();//获取测量结果

		},
		onUnload() {
			//页面销毁中，如果蓝牙还在链接中 断开蓝牙
			if (this.linkSucceeded) {
				this.closeBleFun(); //断开蓝牙
			}
		},
		methods: {
			//获取测量状态
			getMeasurementStatus() {
				this.$https.get(global.apiUrls.getMeasurementStatus, {
					indicId: this.parseData.indicId,
				}).then(res => {
					if (res.data.code == 1000) {
						this.statusList = res.data.result;
					}
				})
			},
			//选择状态
			selectionStatus(item, index) {
				if (item.measureStatusName === '无活动') {
					this.statusList.forEach((v, i) => {
						v.selectFlag = 0;
					})
				} else {
					this.statusList.forEach((v, i) => {
						if (v.measureStatusName === '无活动') {
							v.selectFlag = 0;
						}
					})
				}
				this.statusList[index].selectFlag = item.selectFlag == 1 ? 0 : 1;
			},
			//跳转到手动录入
			manualEntry() {
				this.$urouter.redirectTo({
					url: '/pagesHome/manual-input/manual-input',
					params: {
						data: this.dataTransferred
					}
				});
			},

			//查询推荐的商品 
			getListByGoodsIds(goodsIds) {
				this.$shopnew.get(global.apiUrls.getListByGoodsIds, {
					goodsIds: goodsIds
				}).then(res => {
					if (res.data.code == 1000) {
						this.goodsList = res.data.result;
					}
				})
			},
			//	断开连接
			closeBleFun() {
				let that = this;
				wx.closeBLEConnection({
					deviceId: this.connectedDeviceId,
					success: function() {
						console.log('close sucess')
						that.btnText = '重新搜索'
						that.activeClose = true;
					}
				})
			},

			// 设备记录血压
			addRecord(healthData, mac, deviceId) {
				let measureStatusIds = [];
				this.statusList.forEach(item => {
					if (item.selectFlag == 1) {
						measureStatusIds.push(item.measureStatusId)
					}
				})
				// 修改高低压
				healthData = JSON.parse(healthData)
				healthData.diastolicPre = healthData.lowPre; //低压 
				healthData.systolicPre = healthData.highPre; //高压
				healthData = JSON.stringify(healthData)
				let _this = this,
					fdata = {
						deviceType: 'BLOOD_PRESSURE',
						recordTime: this.$basejs.thisdayFormat2(false, ''),
						inputType: 2, //1手动 2设备
						userId: global.userInfo.userId,
						mac: mac, //设备mac
						deviceId: deviceId, //设备id
						healthDataId: '',
						healthData: healthData,
						measureStatusIds: measureStatusIds.toString(),
					};
				this.$api.post(global.apiUrls.addRecord, fdata).then(res => {
					if (res.data.code == 1000) {
						//如果当前是从打卡界面进入的
						if (this.clockInOrNot) {
							let pages = getCurrentPages(); //当前页面栈
							let beforePage = pages[pages.length - 2]; //指定调用页面为上个页面
							beforePage.$vm.punchTheClock() //getData 是你要调用上个页面的方法，微信小程序不需要用 $vm
							uni.navigateBack({
								delta: 1
							});
						}
						this.getResult(); //获取测量结果
						this.measuring = false; //测量完成
					} else {
						this.measuring = false; //测量完成
						uni.showToast({
							title: res.data.message,
							icon: "none",
							duration: 2000
						});
					}
				}).catch(err => {})
			},
			//获取测量结果
			getResult() {
				this.$https.get('health-service/userHealthData/getLastTime', {
					userId: global.userInfo.userId,
					deviceType: 'BLOOD_PRESSURE',
				}).then(res => {
					if (res.data.code == 1000) {
						this.resultText = res.data.result.indicGrade;
						this.pointerDisplay = false;
					}
				})
			},

			//点击按钮
			clickTheButton() {
				if (this.measuring && this.linkSucceeded) {
					this.$message.info('正在测量中，请勿操作！')
					return
				}
				if (this.linkSucceeded) {
					this.statusPopup = true;
					console.log(this.statusPopup, '弹框有没有激活')
				} else {
					this.Search(); //重新搜索
				}
			},
			//点击弹框中的开始测量
			startMeasurement() {
				this.BleInitial() //开始测量
			},
			startTest() {
				//	发送'01'启动包
				if (this.testShow) {
					this.btnText = '正在测量...';
					this.testData.highPre = '--';
					this.testData.lowPre = '--';
					this.testData.heartRate = '--';
					this.btndis = true;
					this.Send('01');
				}
			},
			//监听低功耗蓝牙设备的特征值变化事件
			onchangeBLE() {
				var that = this;
				wx.onBLECharacteristicValueChange(function(res) {
					var receiveText = that.$basejs.buf2hex(res.value);
					console.log('返回数据' + receiveText)
					//		    '55':为包的开头部分,之后寻找其余部分,然后拼接
					let sePac = that.sevicePackets;
					//		     开头部分为:'55',为新包的开头部分
					let sT = receiveText.substr(0, 2)
					if (sT == '55') {
						sePac = receiveText
						that.sevicePackets = sePac
					} else {
						sePac += receiveText
						that.sevicePackets = sePac
					}
					//		    判断拼接后的包的长度,处理信息包数据
					//			15对=>30长度:信息包00
					//			8对=>16长度:过程包02
					//			14对=>28长度:结果包03
					//			5对=>10长度:错误包EEH&&结束包
					let type;
					type = sePac.substr(4, 2);
					//			判断是否为有效信息,是就进行处理
					if (
						(type == '00' && (sePac.length == 30 || sePac.length == 36)) ||
						(type == '02' && sePac.length == 16) ||
						(type == '03' && sePac.length == 28) ||
						(type == '05' && sePac.length == 20) ||
						((type == 'EE' || type == 'ee') && sePac.length == 20)
					) {
						//处理包
						that.packetsDataFun(sePac)
					}
				})
			},
			pakInfoFun(Text, data) {
				let paL
				paL = this.pakInfoList
				let inf
				inf = Text + data;
				let sT = this.scorollTop + 30
				paL.push(inf)
				this.pakInfoList = paL; //
				this.scorollTop = sT
			},
			//十六转十进制
			handleResult(data) {
				var val = '0x' + data;
				val = parseInt(val);
				return val
			},
			//	发包数据格式处理
			SendData(threeArr) {
				//		计算发包格式:
				//		1.把0--8位置的数相加然后在相加,再加+2==>从而求得位置9的数
				//		2.在分别转换成16进制
				//		获取日期
				let getT = new Date();
				console.log(getT, '55555555555555555555588888888888888888888888888')
				let Ty = '',
					Tm = '',
					Td = '',
					Th = '',
					Tmi = '',
					Ts = '',
					Tdate = '',
					Tadd = '';
				Ty = getT.getFullYear() % 100;
				Tm = getT.getMonth() + 1;
				Td = getT.getDate();
				Th = getT.getHours();
				Tmi = getT.getMinutes();
				Ts = getT.getSeconds();
				Tdate = Ty + '-' + Tm + '-' + Td + ' ' + Th + ':' + Tmi + ':' + Ts;
				//		获取包的最后一位数字
				Tadd = 90 + 10 + Number(threeArr) + Ty + Tm + Td + Th + Tmi + Ts + 2;
				//		这里高字节:大于255的数
				if (Tadd > 255) {
					//			获取最后两位
					Tadd = (Tadd % 255);
				}
				//		转十六进制
				threeArr = '0x' + threeArr.toString(16);
				Ty = '0x' + Ty.toString(16);
				Tm = '0x' + Tm.toString(16);
				Td = '0x' + Td.toString(16);
				Th = '0x' + Th.toString(16);
				Tmi = '0x' + Tmi.toString(16);
				Ts = '0x' + Ts.toString(16);
				Tadd = '0x' + Tadd.toString(16);
				let sendArr = ['0x5A', '0x0A', threeArr, Ty, Tm, Td, Th, Tmi, Ts, Tadd];
				console.log(sendArr)
				let val = new Uint8Array(sendArr);
				var receiveText = this.$basejs.buf2hex(val.buffer)
				if (threeArr == '0x00') {
					this.pakInfoFun('发送信息读取包00：', receiveText)
				} else if (threeArr == '0x01') {
					this.pakInfoFun('启动血压测量包01：', receiveText)
				}
				return sendArr;
			},
			//	发包
			Send(threeArr) {
				var that = this;
				if (that.connected) {
					//发包内容
					let val = new Uint8Array(that.SendData(threeArr));
					console.log(
						'that.connectedDeviceId',
						that.connectedDeviceId,
						'that.serviceId',
						that.serviceId,
						'that.writeCharacteristicsId',
						that.writeCharacteristicsId,
						'val.buffer', val.buffer, '52666666666666666666666666')
					//发送数据到设备中
					wx.writeBLECharacteristicValue({
						deviceId: that.connectedDeviceId,
						serviceId: that.serviceId,
						characteristicId: that.writeCharacteristicsId,
						value: val.buffer,
						success: function(res) {
							console.log('发送成功')
							//        判断如果发送了'00'包还没有返回数据,则再次发送'00'包
							setTimeout(function() {
								if (!that.testShow) {
									that.Send('00')
								}
							}, 30000)
						},
						fail: function(res) {
							console.log('发送包失败')
						}

					})
				} else {
					// that.BlelinkFail()
				}
			},
			//	数据包处理
			packetsDataFun(value) {
				let that = this;
				//.信息包:00	
				//.过程包:02	
				//.结果包:03	
				//.错误包:EE
				//.结束包:05	
				let type = value.substr(4, 2)
				if (type == '00' && (value.length == 30 || value.length == 36)) {
					//	信息包不处理,用于判断
					that.testShow = true;
					that.pakInfoFun('接收数据(拼接后信息包00)：', value)
					// wx.hideLoading();
				} else if (type == '02' && value.length == 16) {
					let vl4 = this.handleResult(value.substr(10, 2))
					this.testData.pressure = vl4
					that.pakInfoFun('接收数据(拼接后过程包02)：', value)
				} else if (type == '03' && value.length == 28) {
					let vl1 = this.handleResult(value.substr(18, 2)) + this.handleResult(value.substr(20, 2));
					let vl2 = this.handleResult(value.substr(22, 2));
					let vl3 = this.handleResult(value.substr(24, 2));
					this.testData.highPre = vl1;
					this.testData.lowPre = vl2;
					this.testData.heartRate = vl3;
					this.btnText = '开始测量';
					let equipmentData = this.testData;
					equipmentData = JSON.stringify(equipmentData)
					// this.tbEquipmentData(this.connectedDeviceId, equipmentData, this.name) //保存记录
					this.addRecord(equipmentData, this.name, this.connectedDeviceId) //记录设备数据信息

					setTimeout(function() {
						that.btndis = false;
					}, 10000)
					that.pakInfoFun('接收数据(拼接后结果包03)：', value)
					// wx.hideLoading();
				} else if (type == '05' && value.length == 20) {
					this.btnText = '开始测量'
					that.pakInfoFun('接收数据(拼接后结束包05)：', value)
					// wx.hideLoading();
				} else if ((type == 'EE' || type == 'ee') && value.length == 20) {
					this.btnText = '开始测量'
					that.pakInfoFun('接收数据(拼接后错误包EE)：', value)
					// wx.hideLoading();
				}
			},


			// 开始测量
			BleInitial() {
				this.measuring = true;
				this.measurementTime = dayjs().format('YYYY-MM-DD HH:mm:ss');
				this.btnText = '测量初始化中';
				var that = this;
				setTimeout(Times => {
					that.startTest()
				}, 3000)
				// that.name = options.name;
				// that.connectedDeviceId = options.connectedDeviceId
				that.onchangeBLE()
				//获取蓝牙设备所有服务
				wx.getBLEDeviceServices({
					deviceId: that.connectedDeviceId,
					success: function(res) {
						console.log('获取设备所有服务')
						console.log(res.services)
						let seAr = res.services
						seAr.forEach(v => {
							if (v.uuid.indexOf("00001000") > -1) {
								that.serviceId = v.uuid;
							}
						})
						//服务有多个需要尝试连接最稳定的那个
						that.getBLEDeviceCharacteristics(that.serviceId)
					}
				})
				//		监听蓝牙连接状态:包括连接异常/断开连接
				wx.onBLEConnectionStateChange(function(res) {
					console.log(res.connected)
					that.connected = res.connected
					if (!res.connected) {
						that.BlelinkFail();
					}
				})

			},

			BlelinkFail() {
				let that = this;
				that.linkSucceeded = false;
				// setTimeout(function() {
				// 	//			判断,如果不是主动断开连接,则提示弹框;
				// 	var pages = getCurrentPages();
				// 	pages = pages.reverse();
				// 	console.log(pages,322222222)
				// 	pages = pages[0].route //当前页面url 
				// 	if (!that.activeClose&&pages == 'pages/subpackage/home/equipment/bloodPressure') {
				// 		wx.showModal({
				// 			title: '提示',
				// 			showCancel: false,
				// 			content: '蓝牙已断开连接，重新连接？',
				// 			success(res) {
				// 				if (res.confirm) {
				// 					that.Search()
				// 				}
				// 			}
				// 		})
				// 	}
				// }, 500)
			},

			//	获取设备特征值
			getBLEDeviceCharacteristics(seId) {
				let that = this;
				wx.getBLEDeviceCharacteristics({
					deviceId: that.connectedDeviceId,
					serviceId: seId,
					success: function(res) {
						console.log('对应服务的特征值')
						console.log(res.characteristics)
						//              	 获取到的特征值有多个，最后要用的事能读，能写，能监听的那个值的uuid作为特征值
						let chaArr = res.characteristics
						res.characteristics.forEach(v => {
							if (v.uuid.indexOf("00001002") > -1) {
								that.notifyCharacteristicsId = v.uuid
							}
							if (v.uuid.indexOf("00001001") > -1) {
								that.writeCharacteristicsId = v.uuid
							}
						})
						that.notifyBLECharacteristicValueChange()
					},
					fail: function(error) {
						console.log('获取特征值失败')
						console.log(error)
					}
				})
			},
			//启用低功耗蓝牙设备特征值变化时的 notify 功能
			notifyBLECharacteristicValueChange() {
				var that = this;
				wx.notifyBLECharacteristicValueChange({
					state: true,
					deviceId: that.connectedDeviceId,
					serviceId: that.serviceId,
					characteristicId: that.notifyCharacteristicsId,
					success(res) {
						console.log(res, '启用低功耗蓝牙设备监听成功')
						setTimeout(function() {
							that.Send('00')
						}, 1000)
					},
					complete(res) {},
					fail(error) {
						console.log(error, '启用低功耗蓝牙设备监听失败')
					}
				})
			},



			//搜索设备
			Search() {
				this.BleInitialonlaod(); //初始化蓝牙
				this.preTestSteps = true;
				wx.showLoading({
					title: '搜索设备中...',
				})
				var that = this
				if (!that.searching) {
					wx.closeBluetoothAdapter({
						complete: function(res) {
							console.log(res)
							wx.openBluetoothAdapter({
								success: function(res) {
									console.log(res)
									wx.getBluetoothAdapterState({
										success: function(res) {
											console.log(res)
										}
									})
									wx.startBluetoothDevicesDiscovery({
										allowDuplicatesKey: false,
										success: function(res) {
											console.log(res)
											that.searching = true;
										}
									})
								},
								fail: function(res) {
									wx.hideLoading()
									console.log(res)
									wx.showModal({
										title: '提示',
										content: '请检查手机蓝牙是否打开',
										showCancel: false,
										success: function(res) {
											that.searching = false
										}
									})

									that.btnText = '重新搜索'
								}
							})
						}
					})
				} else {
					wx.stopBluetoothDevicesDiscovery({
						success: function(res) {
							console.log(res)
							that.searching = false
						}
					})
				}
			},

			// 蓝牙初始化
			BleInitialonlaod() {
				let that = this;
				console.log('onLoad');
				wx.onBluetoothAdapterStateChange(function(res) {
					console.log(res)
					that.searching = res.discovering
					if (!res.available) {
						that.searching = false
					}
				})
				wx.onBluetoothDeviceFound(function(devices) {
					console.log('获取蓝牙设备') //蓝牙设备列表
					console.log(devices.devices[0]) //蓝牙设备列表
					console.log(devices.devices[0].name) //蓝牙设备列表
					console.log(devices.devices[0])
					let name = devices.devices[0].name
					if (name == that.chooseType) {
						that.Connect(devices.devices[0])
					}
				})
			},
			//链接指定蓝牙
			Connect(data) {
				let that = this
				let chT = this.chooseType;
				let urlPath = ''
				wx.stopBluetoothDevicesDiscovery({
					success: function(res) {
						console.log(res)
						that.searching = false
					}
				})
				wx.showLoading({
					title: '连接设备中...',
				})
				wx.createBLEConnection({
					deviceId: data.deviceId,
					success: function(res) {
						console.log(res, '链接成功的信息设备信息')
						wx.hideLoading()
						wx.showToast({
							title: '连接成功',
							icon: 'success',
							duration: 1000
						})
						that.linkSucceeded = true;

						that.name = data.name;
						that.connectedDeviceId = data.deviceId
					},
					fail: function(res) {
						console.log(res)
						wx.hideLoading()
						wx.showModal({
							title: '提示',
							content: '连接失败',
							showCancel: false,
						})
						that.btnText = '重新连接'
						that.linkSucceeded = false;
					}
				})
			},

		}
	}
</script>

<style lang="scss">
	.measurement-status {
		display: flex;
		align-items: center;
		justify-content: space-between;
		flex-wrap: wrap;
		padding: 15rpx 24rpx 0rpx;
		background-color: #fff;

		.every-button {
			margin-bottom: 20rpx;
		}
	}

	.equipmentbg {
		padding: 40rpx 0rpx;
		width: 100vw;
		min-height: 100vh;
		background: linear-gradient(180deg, #DAEFFB 0%, #94D9DD 100%);

		.step-description {
			display: flex;
			padding: 0rpx 40rpx;

			.bz-text {
				width: 108rpx;
				font-size: 36rpx;
				font-weight: 500;
				color: #2EA7E0;
			}

			.small-text {
				padding: 6rpx 0rpx;
				width: 570rpx;
				font-size: 26rpx;
				font-weight: 400;
				color: #2EA7E0;
				line-height: 36rpx;
			}

		}

	}

	.equipment-power {
		height: 102rpx;
		background-color: #fff;
		padding: 0 24rpx;

		.characters {
			margin-left: 16rpx;
			font-size: 28rpx;
			font-weight: 400;
			color: #9B9B9B;
		}
	}

	.device-search {
		display: flex;
		align-items: center;
		justify-content: center;
		flex-direction: column;
		background-color: #fff;
		margin-top: 30rpx;
		padding: 60rpx 0rpx;

		.pointer-background {
			position: relative;
			width: 418rpx;
			height: 224rpx;
			background-image: url('http://static.bsyjk.cn/shoppingMall/850344C22F6347CB8E3B2615FB029550.png');
			background-size: 100% 100%;
			text-align: center;
			line-height: 324rpx;
			font-size: 50rpx;
			font-weight: 500;

			.pointer {
				position: absolute;
				width: 174rpx;
				height: 60rpx;
				background-image: url('http://static.bsyjk.cn/shoppingMall/E9B0F6948EAB4F7E9AA0B614AF74A7A8.png');
				background-size: 100% 100%;
				top: 170rpx;
				left: 68rpx;
				transform-origin: 140rpx 50%;
			}

			.pointer-text {
				position: absolute;
				width: 174rpx;
				height: 60rpx;
				background-size: 100% 100%;
				top: 152rpx;
				left: 114rpx;
				transform-origin: 140rpx 50%;
				margin-left: 16rpx;
				font-size: 38rpx;
				font-weight: 400;
				color: #9B9B9B;
			}
		}
	}

	.reminder {
		height: 78rpx;
		display: flex;
		align-items: center;
		font-size: 26rpx;
		font-weight: 400;
		color: #F5A623;
		padding: 0rpx 20rpx;
	}

	.measure-box {
		padding: 30rpx 24rpx;
		background-color: #fff;

		.measurement-time {
			font-size: 26rpx;
			font-weight: 400;
			color: #2EA7E0;
		}

		.data-below {
			display: flex;
			align-items: center;
			justify-content: space-between;
			margin-top: 20rpx;

			.value-box {
				width: 552rpx;
				height: 233rpx;
				background: linear-gradient(180deg, #BDFFF3 0%, #4AC29A 100%);
				border-radius: 42rpx;
				display: flex;
				align-items: center;
				justify-content: space-between;
				padding: 0rpx 16rpx;

				.big-name {
					font-size: 68rpx;
					font-weight: 500;
					color: #FFFFFF;
				}

				.small-name {
					font-size: 26rpx;
					font-weight: 400;
					color: #FFFFFF;
				}
			}

			.manual-input {
				width: 137rpx;
				height: 233rpx;
				background: linear-gradient(181deg, #8EE6CE 0%, #8EE6CE 100%);
				border-radius: 30rpx;
				display: flex;
				flex-direction: column;
				justify-content: center;
				padding: 0 14rpx;
				color: #fff;
				font-size: 28rpx;
			}
		}

	}

	.recommended-products {
		margin-top: 30rpx;
		background-color: #fff;
		padding: 54rpx 22rpx;

		.product-list {
			height: 185rpx;
			display: flex;
			justify-content: space-between;
			margin-bottom: 30rpx;

			.detailed-information {
				width: 500rpx;
				display: flex;
				flex-direction: column;
				justify-content: space-between;

				.product-description {
					font-size: 26rpx;
					font-weight: 400;
					color: #333333;
					line-height: 36rpx;
				}

				.sale-price {
					font-size: 26rpx;
					font-weight: 400;
					color: #FF333A;
				}

				.original-price {
					margin-left: 20rpx;
					font-size: 26rpx;
					font-weight: 400;
					color: #9B9B9B;
					text-decoration: line-through;
				}
			}
		}
	}
</style>
